Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: Messagebox not compiling when within parentheses
~Umberto Nongeroson 28.Oct.03 02:21 AM a Web browser
Domino Designer 6.0.1 CF1 Windows 2000


Anytime you use a function or subroutine, including a system function, you have two choices (for a subroutine) or three (for a function).*

For a function, you can use the function call syntax FuncName(arg1, arg2). But to use the function call syntax, you must do something with the return value. E.g: result = FuncName(arg1, arg2) or Print FuncName(arg1, arg2).

For a subroutine or a function, you can use the statement syntax (discarding the return value, if it's a function). E.g.:
    SubOrFuncName arg1, arg2
For a subroutine or function, you can use the Call syntax, e.g.:
    Call SubOrFuncName(arg1, arg2)

You can legally use Call and include parens, or leave off Call and also leave off the parens. You can't leave off Call and still use parens, as you were trying to do.

Some people get confused about this because if a subroutine or function has one argument, in many cases you can use the statement syntax and include parens, e.g.:
    SubOrFuncName(x)

In this case, strange as it may seem, the parenthesis are considered not to enclose the list of arguments, but only the first argument -- there just happens to be only one. These parens actually have a functional meaning -- they force the argument to be passed by value -- the subroutine is given a copy, so that it can't alter the original value. The equivalent Call syntax would be:
    Call SubOrFuncName((x))

Or if there are multiple arguments, you might write something like this:
    SubOrFuncName x, (y), z
You can enclose a single argument in parenthesis, and the previous example was the degenerate case where there was only one argument, that that argument is in parens.

But you can't write:
    SubOrFuncName(x, y) ' wrong!
for the same reason you can't do the following assignment:
    a = (x, y)

In the statement syntax, parens are expected to enclose an expression, not a list of parameters. So when the parser sees a comma after x, it gets confused. In an expression, you can't use a comma right after a variable name or constant -- the parser was expecting to see either an operator (e.g. "+") or the close paren. Does that make the error message clearer?


* If I don't mention it, some picky person will probably point out that for many system functions you can only use the function syntax. Messagebox is not one of these.

Not all types of variables can be treated in this way, so depending on how x is declared, in some cases this syntax may still be illegal.





Messagebox not compiling when withi... (~Tate Quetgerob... 27.Oct.03)
. . RE: Messagebox not compiling when w... (~Bill Frokimari... 28.Oct.03)
. . maybe your msg is too long? (~Holly Lopfooge... 28.Oct.03)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS